#! /bin/bash

# 从文本中读取主机列表，然后自动逐个测试测试主机是否在线

HLIST=$(cat ./ipadds.txt)

for IP in $HLIST
do
ping -c 3 -i 0.2 -w 3 $IP &> /dev/null
if [ $? -eq 0 ] ;
then
echo "Host $IP is On-line."
else
echo "Host $IP is off-line."
fi
done

